<?php
include('../global.php');

if(isset($_POST['admin_login'])){
	$admin_vertification = strtoupper($_POST['admin_vertification']);
	$pwd = md5($_POST['admin_pwd']);
	$sql = "SELECT * FROM  `admin_manager` WHERE `username` = '".$_POST['admin_username']."' AND `password` = '$pwd' AND `status` = 1";
	$query = $db->query($sql);
	$row = $db->fetch_array($query);
	$num = $db->num_rows($query);
	if($num == 1 && $admin_vertification == $_SESSION['check_code']){
	$_SESSION['admin_id'] = $row['id'];
		$db->jumpAction("report.php","登陆成功");
	}else{
		$db->jumpAction("index.php","登陆失败，请重新登录");
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="facemash"><!--SEO关键字-->
<meta name="description" content=""><!--SEO描述-->
<link rel ="" href=""><!--选项卡图标-->
<title>Admin - Facemash | Huanu</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/common.css">
<link rel="stylesheet" href="css/page.css">
<!--[if ie 6]>
<link rel="stylesheet" href="css/ie6.css">
<![endif]-->
</head>

<body>
	<div id="header" class="tc cf h150"><!-- header -->
		<h1 class="f80 h80 logo">Admin - Facemash</h1>
		<p class="f24 mt5">选出你心目中的女神（湖南农大专场）</p>
		<div id="nav" class="mt15">
			<a href="index.php" class="cf p10">打假管理</a>
			<a href="rank.php" class="cf p10">申诉管理</a>
			<a href="report.php" class="cf p10">排名管理</a>
		</div>
	</div><!-- end_header -->
	<div id="main" class="w960 bc oh h300 mt50"><!-- main -->
		<form action="" method="POST" class="bc w300 mt50">
			<p class="mb20"><label for="">账 号：</label><input type="text" value="" name="admin_username" class="w200 h30 admin_input_border"/></p>
			<p class="mb20"><label for="">密 码：</label><input type="password" value="" name="admin_pwd" class="w200 h30 admin_input_border"/></p>
			<p class="mb20 oh"><label for="" class="fl">验 证：</label><input type="text" value="" name="admin_vertification" class="h30 w100 admin_input_border fl" /><a href="" id="changeVertification"><img src="common/verification.class.php" alt="" class="ml20 fl" id="vertification" /></a></p>
			<p><input type="submit" value="登录" name="admin_login" class="ml60 admin_login_sub h30 w100 cf"/></p>
		</form>
	</div><!-- end_main -->
	<div id="footer" class=" tc w960 bc c9 mt20 pb20"><!-- footer -->
		<p>&copy;2012 Hunau_Jinan</p>
	</div><!-- end_footer -->
	
	<!-- javascript -->
	<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="js/script.js"></script>
</body>
</html>